package com.ugoodtech.mdcc.client.controller.ResponseObject;

import com.ugoodtech.mdcc.core.Constants;
import com.ugoodtech.mdcc.core.domain.Station;
import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;

public class PersonKpiResponse {

    private SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT);

    private Long stationId = 0L;

    private Long reportId = 0L;

    private String stationName = "";

    private String address = "";

    private String userName = "";

    private String dateTime = "";

    private int[] index = new int[3];

    public PersonKpiResponse(Station station) {
        this.stationId = station.getId();
        this.stationName = station.getName();
        String province = "";
        if (StringUtils.isNotEmpty(station.getProvince())) {
            province = station.getProvince();
        }
        String city = "";
        if (StringUtils.isNotEmpty(station.getCity())) {
            city = station.getCity();
        }
        if (province.equals(city)) {
            this.address = province;
        } else {
            this.address = province + city;
        }
        this.dateTime = simpleDateFormat.format(station.getUpdateTime());
    }

    public Long getStationId() {
        return stationId;
    }

    public void setStationId(Long stationId) {
        this.stationId = stationId;
    }

    public Long getReportId() {
        return reportId;
    }

    public void setReportId(Long reportId) {
        this.reportId = reportId;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public int[] getIndex() {
        return index;
    }

    public void setIndex(int[] index) {
        this.index = index;
    }
}
